//
// Created by yunnan xu on 2020/12/14.
//

#ifndef ANDROIDGRAPHICSDEMOS_SHADOWMAPPASS_H
#define ANDROIDGRAPHICSDEMOS_SHADOWMAPPASS_H

#include "Pass.h"
#include "GLESUtils.h"
#include <unordered_map>
#include <string>
#include <EGL/egl.h>
#include <GLES3/gl32.h>



template <GraphicsAPI> class Texture2D;

template<GraphicsAPI API> class ShadowMapPass;

template<> class ShadowMapPass<GraphicsAPI::GLESv3> : public GLESPass
{
public:

    ShadowMapPass();
    virtual ~ShadowMapPass() = default;
    virtual void Draw();

protected:
    virtual void InitShaderUniformLocation();

private:

    int lightMVP_location;

    GLuint framebuffer;
    std::shared_ptr<Texture2D<GraphicsAPI::GLESv3>> depthTexture;
    int32_t width;
    int32_t height;
};


#endif //ANDROIDGRAPHICSDEMOS_SHADOWMAPPASS_H
